# Definition for a binary tree node.
class TreeNode:
    def __init__(self, x):
        self.val = x
        self.left = None
        self.right = None

class Solution:
    def countNodes(self, root: TreeNode) -> int:
        if root is None:
            return 0
        return self.countNodes(root.left) + self.countNodes(root.right) + 1


if __name__ == '__main__':
    so = Solution()
    nums = [1,5,9,1,5,9]
    k = 2
    t = 3
    r = so.containsNearbyAlmostDuplicate(nums, k, t)
    print(r)
